package org.example.designmodel.forkjoin;

import java.util.concurrent.ForkJoinPool;
import java.util.concurrent.TimeUnit;

public class ForkJoinTes {
    public static void main(String[] args) throws Exception{
        ForkJoinPool forkJoinPool = new ForkJoinPool();
        AccumulateTask task = new AccumulateTask(1, 100);
        // 外部提交任务
        forkJoinPool.submit(task);
        int result = task.get(1, TimeUnit.HOURS);
        System.out.println("result = " + result);
    }
}
